#include <iostream>

using std::cout;
using std::endl;

class A
{
protected:
    //A的构造函数对派生类是开放了权限的
    A(long a)
    : _a(a)
    {   cout << "A(long)" << endl;}

public:
    void print() const
    {   cout << "_a:" << _a << endl;    }

private:
    long _a;
};

class B
: public A
{
public:
    B(long a, long b)
    : A(a)
    , _b(b)
    {   cout << "B(long,long)" << endl; }

private:
    long _b;
};

int main()
{
    //A a(10);//不能在类之外直接创建对象, A 无法实例化对象
    B b(10, 20);

    return 0;
}

